$(function(){
	var headPath = localStorage.getItem("head_image");
	console.log("headPath:" + headPath);
	
	$("#header_tp").attr("src", headPath); 
	
//	$("#createtp").click(function(){
//		location.href = "http://yx.fxtourong.com/V1/Goods/createtopic_view";
//	});
//	$("#createzj").click(function(){
//		location.href = "http://yx.fxtourong.com/V1/Goods/create_zj.html";
//	});
	var goodsid = localStorage.getItem("goods_id");
	var store_id = localStorage.getItem("store_id");
	var urlPath = "http://yx.fxtourong.com/V1/Goods/getGoodsDetails" + "?store_id=" + store_id + "&goods_id=" + goodsid;
	$.ajax({
			type: "GET",
			url: urlPath,
			data: {
				},
			dataType: "json",
			success: function(data) {
				console.log(data);
				var code = data.code;
				console.log(code);
				if(code == "1") {
					$("#detail_type").text(data.data.type_name);
					var is_pwd = data.data.is_encrypt;
					if(is_pwd == "0"){
						$("#detail_pwd").text("否");
					} else {
						$("#detail_pwd").text("***");
					}
					var is_pay = data.data.is_pay;
					if(is_pay == "1"){
						var price = data.data.price;
						$("#detail_price").text(price + "");
					} else {
						$("#detail_price").text("免费");
					}
					var audioPath = data.data.audio;
					$("#test_listen5").append(" <audio style='margin-top: 14px;' controls='controls'>" + "<source src='" + audioPath + "'" + +" type='audio/mpeg'>" + "</audio>");
//					var imageStr = data.data.cover;
//					var images = imageStr.split(',');
//					var $slider = $('#demo-slider-0');
//					for(var i = 0; i<images.length; i++){
//						var imagePath = images[i];
//						var lihtml = " <li>" + "<img src='" + imagePath + "'" + " style='height: 200px;'/>" + "</li>";
//						console.log("images:" + lihtml);
//					    $slider.flexslider('addSlide', lihtml);
//					}
					localStorage.setItem("topic_image", data.data.cover);
					$("#name").text(data.data.name);
					$("#detail_detail").text(data.data.details);
				}
			}
		});
		
		$("#look_image").click(function(){
			
		});

});
